package com.goldcn.sys.dao;
import com.goldcn.sys.model.GcnSysUser;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


public interface GcnSysUserMapper {
    int deleteByPrimaryKey(String userID);

    int insert(GcnSysUser record);

    int insertSelective(GcnSysUser record);

	GcnSysUser selectByPrimaryKey(String userID);

    int updateByPrimaryKeySelective(GcnSysUser record);

    int updateByPrimaryKey(GcnSysUser record);

	/**
	 * 查询角色未关联用户
	 * @param roleID
	 * @return
	 */
	List<GcnSysUser> findUnRelatedUser(@Param(value = "roleID") String roleID);

	/**
	 * 查询角色已关联用户
	 * @param roleID
	 * @return
	 */
	List<GcnSysUser> findRelatedUser(@Param(value = "roleID") String roleID);

	int selectAllNum(@Param(value = "condition") String condition);

	List<Object> selectAll(@Param(value = "startRow") int startRow,
						   @Param(value = "limitRow") int limitRow,
						   @Param(value = "condition") String condition,
						   @Param(value = "sortField") String sortField,
						   @Param(value = "sortOrder") String sortOrder);

	Map<String,Object> getUserInfo(@Param(value = "userId") String userId);

	List<Map<String,String>> findUserRoles(@Param(value = "userID") String userID);

	//用户名唯一性验证
	int validUnique(@Param(value = "condition") String condition);

	GcnSysUser validateUserLogin(Map<String, Object> map);
}